# -*- coding: utf-8 -*-
from datetime import timedelta

from odoo import models, fields, api
import pymssql

server = "gx2019.3322.org"
user = "sa"
password = "1234.com"
database = "kaoqin"

startTime = '2020-10-01 00:00:00'
endTime = '2020-10-01 23:59:59'



class HrRecordImport(models.TransientModel):
    _name = 'hr.record.import'
    date=fields.Date(string=u'日期',default=fields.Date.today)

    def action_confirm(self):
        pass
        # db = pymssql.connect(server, user, password, database, charset='utf8')
        # cursor = db.cursor()
        # # 判断时间段内是否有数据缺失和ID的sql语句
        # id_sql = "SELECT card_id from hr_record where  card_date_time >='" + startTime + "' and card_date_time <= '" + endTime + "' "
        # cursor.execute(id_sql)
        # row = cursor.fetchall()
        # db.close()